#include "StdAfx.h"
#include "PixelCalc.h"
#include "pixelStorage.h"
#include <opencv/cv.hpp>
#include <highgui/highgui.hpp>

using namespace cv;
  
PixelCalc::PixelCalc(void)
{
  PixelStorage pS;

  string image = "2DObjekte.png";
  pS.image = imread(image, 1);
}

PixelCalc::~PixelCalc(void)
{
}

void minMaxHue(PixelStorage pS)
{
  /*int histSize[2] = {30, 32};
  int channels[2] = {0, 1};*/

  pS.tileImage = pS.outImage(Range(pS.posY1, pS.posY2), Range(pS.posX1, pS.posX2));

  minMaxLoc(pS.tileImage, pS.minVal, pS.maxVal, 0, 0);
}

void contours()
{
  PixelStorage p;

  findContours(p.outImage, p.objcontours, p.hierarchy,
               CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);

}

void PixelCalc::loadPicture(Mat image)
{
  namedWindow("Image", CV_WINDOW_AUTOSIZE);

  imshow("Image", image);
}